<?php

namespace App\Http\Requests;

/**
 * @OA\Schema(
 *     required={"name","phone","captcha","password"}
 * )
 */
class UserAddressRequest extends BaseRequest
{

    /**
     * @OA\Property(property="name", format="string", description="收件人姓名", default=""),
     * @OA\Property(property="phone", format="string", description="联系电话", default=""),
     * @OA\Property(property="area", format="string", description="所在地区", default=""),
     * @OA\Property(property="address", format="string", description="详细地址",  default=""),
     * @OA\Property(property="is_default", format="string", description="是否默认;0=否,1=是",  default="0"),
     */
    public function rules(): array
    {
        return [
            'name' => ['required'],
            'phone' => ['required','mobile'],
            'area' => ['required'],
            'address' => ['required'],
            'is_default' => [],
        ];
    }


    public function messages(): array
    {
        return [
            'name.required'=>'收件人姓名不能为空!',
            'phone.required'=>'手机号不能为空!',
            'phone.mobile'=>'手机号规则错误!',
            'area.required'=>'所在地区码不能为空!',
            'address.required'=>'密码不能为空!'
        ];
    }
}
